
// OrderService.java
package demo.service;
import mini.spring.annotations.Component;
import mini.spring.annotations.Autowired;
import mini.spring.annotations.PostConstruct;

@Component
public class OrderService {
    @Autowired
    private UserService userService;

    @PostConstruct
    public void init() {
        System.out.println("OrderService init, userService = " + userService);
    }

    public void placeOrder() {
        System.out.println("Placing order for user: " + userService.getUserName());
    }
}